<template>
	<view class="container-settle">
		<navbar :config="config" backColor="#000"></navbar>
		<view class="top ql-editor-box" v-html="content"></view>
		<view class="footer">
			<view class="online-btn " @click="jumpSettle(0)">线上商家入驻</view>
			<view class="online-btnTwo" @click="jumpSettle(1)">联盟商家入驻</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				config: {
					back: true, //false是tolbar页面 是则不写
					title: '商家入驻',
					color: '#000',
					//背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
					backgroundColor: [1, "#fff"],
					statusBarFontColor: '#1A1A1A',
					backIconColor: "#000"
				},
				content: '',
			}
		},
		onLoad() {
			this.getShopConfig()
		},
		methods: {
			// 获取商家入驻协议
			getShopConfig() {
				this.$http.get('/protocolConfig/info/tenants-agreement').then(res => {
					if (res.code == 200) {
						this.content = res.data.content
					}
				})
			},
			jumpSettle(settleMode) {
				this.$http.get("/yxt/shopapply/shopApplyInfo", {
					union_business: settleMode == 0 ? false : true
				}).then(res => {
					if (res && res.code == 200) {
						if (res.data == null) {
							uni.navigateTo({
								url: `/pages/user/merchant/registerAndAudit?settleMode=${settleMode}`
							})
						} else {
							if (settleMode == 0) {
								uni.navigateTo({
									url: "/pages/user/merchant/audit"
								})
							} else {
								uni.navigateTo({
									url: "/pages/workbench/shop/audit"
								})
							}
						}
					}
				})

			}
		}
	}
</script>

<style lang="scss" scoped>
	.container-settle {

		.top {
			padding: 30rpx;
			padding-bottom: 200rpx;

			.content {
				padding: 0 14rpx 26rpx 14rpx;
				font-size: 24rpx;
				color: #666666;
				font-weight: 500;
				line-height: 48rpx;
			}
		}

		/deep/ .ql-editor-box {
			// font-weight: 400;
			color: #474747;
			font-size: 16px;

			img {
				border-radius: 20rpx;
			}
		}

		.footer {
			width: 100%;
			position: fixed;
			bottom: 31rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			width: 673rpx;
			height: 96rpx;
			margin-left: 38rpx;

			.btn {
				width: 298rpx;
				color: #fff;
				text-align: center;
				line-height: 85rpx;
				border: 1rpx solid #FF721B;
				border-radius: 44rpx;
				background-color: #FF721B;
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Regular;
				font-weight: 400;
				text-align: center;
			}

			.online-btn {
				width: 317rpx;
				height: 96rpx;
				border-radius: 19rpx 19rpx 19rpx 19rpx;
				border: 2rpx solid #FF211F;
				font-weight: 400;
				font-size: 29rpx;
				color: #FF211F;
				display: flex;
				flex-direction: row;
				justify-content: center;
				align-items: center;
				margin-right: 38rpx;
			}
			.online-btnTwo{
				width: 317rpx;
				height: 96rpx;
				background: #FF211F;
				border-radius: 19rpx 19rpx 19rpx 19rpx;
				font-weight: 400;
				font-size: 29rpx;
				color: #FFFFFF;
				display: flex;
				flex-direction: row;
				justify-content: center;
				align-items: center;
			}
		}
	}
</style>